package com.syl.ippool.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 一个基本ip的 pojo类
 */
public class IpBasePojo implements Serializable {

    // ip地址
    private String ip;

    // 端口
    private int port;

    // ip地区
    private String region;

    // 获得时间
    private Date getDate;

    // 是否活跃
    private boolean active = true;

    // 健康分数满分100
    private int healthScore;

    private String iptype;


    public String getIptype() {
        return iptype;
    }

    public void setIptype(String iptype) {
        this.iptype = iptype;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public Date getGetDate() {
        return getDate;
    }

    public void setGetDate(Date getDate) {
        this.getDate = getDate;
    }

    public boolean getActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public int getHealthScore() {
        return healthScore;
    }

    public void setHealthScore(int healthScore) {
        this.healthScore = healthScore;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IpBasePojo that = (IpBasePojo) o;
        return port == that.port &&
                ip.equals(that.ip);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ip, port);
    }

    @Override
    public String toString() {
        return "IpBasePojo{" +
                "ip='" + ip + '\'' +
                ", port=" + port +
                ", region='" + region + '\'' +
                ", getDate=" + getDate +
                ", active=" + active +
                ", healthScore=" + healthScore +
                ", iptype='" + iptype + '\'' +
                '}';
    }
}
